Points of Markdown

Basic writing

Paragraphs

Paragraphs in Markdown are just one or more lines of consecutive text followed by one or more blank lines.

You can create a heading by adding one or more # symbols before your heading text. The number of # you use will determine the size of the heading.

1
2
3
4
# The largest heading (an <h1> tag)
## The second largest heading (an <h2> tag)

###### The 6th largest heading (an <h6> tag)

Block-quotes

You can indicate block-quotes with a >

1
2
3
In the words of Abraham Lincoln:

> Pardon my French

Styling text

1
2
*This text will be italic*
**This text will be bold**

Both bold and italic can use either a * or an _ around the text for styling. This allows you to combine both bold and italic if needed.

1
**Everyone _must_ attend the meeting at 5 o'clock today.**

Lists

Unordered lists

You can make an unordered list by preceding list items with either a * or a -.

1
2
3
4
5
* Item
* Item

- Item
- Item

Ordered lists

You can make an ordered list by preceding list items with a number.

1
2
1. Item 1
2. Item 2

Nested lists

You can create nested lists by indenting list items by two spaces.

1
2
3
4
5
1. Item 1
1. A corollary to the above item.
2. Item 2
* A corollary that does not need to be ordered.
* This is indented four spaces.

Code syntax highlighting

In-line formats

Use single back-ticks (`) to format text in a special mono-space format. Everything within the back-ticks appear as-is, with no other special formatting.

1
Here's an idea: why don't we take `SuperiorProject` and turn it into `**Reasonable**Project`.

Multiple lines

You can use triple back-ticks (```) to format text as its own distinct block.

1
2
3
4
``` 
x = 0
x = 2 + 2
```

Syntax highlighting

In fenced block, add an optional language identifier for syntax highlighting.
For example, to syntax highlight Ruby code:

1
2
3
4
5
```ruby
require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html
```

You can create an in-line link by wrapping link text in brackets ( [ ] ), and then wrapping the link in parentheses ( ( ) ).

For example, to create a hyper-link to www.github.com, with a link text that says, Visit GitHub!, you’d write this in Markdown: [Visit GitHub!](https://www.github.com).

Image

In-line image:

1
![Alt Msg](URL)

Block image:

1
![Alt Msg][URL]

GitHub Flavored Markdown

underscores in words

Where Markdown transforms underscores (_) into italics, GFM ignores underscores in words. To emphasize a portion of a word, use asterisks (*).

URL auto-linking

GFM will auto-link standard URLs, so if you want to link to a URL (instead of setting link text), you can simply enter the URL and it will be turned into a link to that URL.

1
http://example.com

becomes: http://example.com

Strike-through

GFM adds syntax to create strike-through text, which is missing from standard Markdown.

1
~~Mistaken text.~~

becomes: Mistaken text.

Tables

You can create tables by assembling a list of words and dividing them with hyphens - (for the first row), and then separating each column with a pipe |:

1
2
3
4
First Header  | Second Header
------------- | -------------
Content Cell | Content Cell
Content Cell | Content Cell

You can also add extra pipes on the ends:

1
2
3
4
| First Header  | Second Header |
| ------------- | ------------- |
| Content Cell | Content Cell |
| Content Cell | Content Cell |

Dashes don’t need to match the length of text:

1
2
3
4
| Name | Description          |
| ------------- | ----------- |
| Help | Display the help window.|
| Close | Closes a window |

Finally, by including colons : within the header row, you can define text to be left-aligned, right-aligned, or center-aligned:

1
2
3
4
5
| Left-Aligned  | Center Aligned  | Right Aligned |
| :------------ |:---------------:| -----:|
| col 3 is | some wordy text | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |

A colon on the left-most side indicates a left-aligned column; a colon on the right-most side indicates a right-aligned column; a colon on both sides indicates a center-aligned column.